import requests


class IhrmDeptCRUDApi:
    @staticmethod
    def add_dept_api(dept_data, token):
        return requests.post("http://localhost:8080/api/company/department",
                             json=dept_data, headers={"Authorization": "Bearer " + token})

    @staticmethod
    def query_dept_api(dept_id, token):
        return requests.get("http://localhost:8080/api/company/department/" + dept_id,
                            headers={"Authorization": "Bearer " +  token})

    @staticmethod
    def modify_dept_api(dept_id, dept_data, token):
        return requests.put("http://localhost:8080/api/company/department/" + dept_id,
                            json=dept_data, headers={"Authorization": token})

    @staticmethod
    def delete_dept_api(dept_id, token):
        return requests.delete("http://localhost:8080/api/company/department/" + dept_id,
                               headers={"Authorization": "Bearer " +  token})

